package com.feeyo.prophet.pojo.enums;

/**
 * 航班种类
 */
public enum FcategoryEnum {
    ZERO("0", "国内-国内"),
    ONE("1", "国内-地区"),
    TWO("2", "国内-国际"),
    THREE("3", "地区-地区"),
    FOUR("4", "地区-国际"),
    FIVE("5", "国际-国际"),
    ;
    public final String code;
    public final String value;

    FcategoryEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    // 通过code 找name
    public static String getValueByCode(String code) {
        for (FcategoryEnum fcategoryEnum : FcategoryEnum.values()) {
            if (fcategoryEnum.getCode().equals(code)) {
                return fcategoryEnum.getValue();
            }
        }
        return null;
    }
}
